home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 57 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.4 KB  |  49 lines

  1. Path: fido.asd.sgi.com!austern
  2. From: "B. Dalton" <bdalton@xagony.ilo.dec.com>
  3. Newsgroups: comp.std.c++
  4. Subject: type_info
  5. Date: 17 Jan 1996 12:22:51 PST
  6. Organization: DEC Gaillimh
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <30FD350D.A71@xagony.ilo.dec.com>
  9. NNTP-Posting-Host: isolde.mti.sgi.com
  10. X-Original-Date: Wed, 17 Jan 1996 17:42:37 +0000
  11. X-Mailer: Mozilla 2.0b3 (WinNT; I)
  12. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  13.     iQBVAwUBMP1arky4NqrwXLNJAQETJAH9EhZcPtodimqENiEQDMMuMM0Qx0N3QVg0
  14.     JgZ4XFwFgkxiAW30ySNJg3z60FrygLnRas5ERgTrcLLn2T7oeZBWzQ==
  15.     =IyrT
  16. Originator: austern@isolde.mti.sgi.com
  17.  
  18. The April draft says(see 
  19. http://www.cygnus.com/misc/wp/draft/lib-support.html#lib.support
  20. .rtti) about type_info::operator==
  21.  
  22.   bool operator==(const type_info& rhs) const;
  23.  
  24.   Effects:
  25.     Compares the current object with rhs.
  26.   Returns:
  27.     true if the two values describe the same type.
  28.  
  29. What does "same" mean here? To be specific, say we had
  30. ...
  31. class beatha{public:virtual ~beatha(){};}
  32. class duine:public beatha{};
  33. class gael: public duine {};
  34.  
  35. beatha *pd=new gael;
  36. if(typeid(pd)==typeid(duine)
  37. {    cout<<"duine";
  38. }
  39. ...
  40. does "duine" get printed here or not?
  41.  
  42. -- 
  43. B. Dalton         DEC - Gaillimh
  44. mailto:bdalton@xagony.ilo.dec.com
  45. ---
  46. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  47.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  48.   is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
  49.